import request from '../../utils/request'
import { createSheetType, getSheetType, updateSheetType, sheetUserType } from "./type.ts";
enum API {
    CREATESHEET = '/sheet/createSheet',
    GETSHEET = '/sheet/getSheet',
    UPDATESHEET = '/sheet/updateSheet',
    DELSHEETUSER = '/sheet/delSheetUser',
    ADDSHEETUSER = '/sheet/addSheetUser',
    ADDFAVORITES = '/sheet/addFavorites'
}

export const createSheet = (data: createSheetType) => request.post(API.CREATESHEET, data)
export const getSheet = (data: getSheetType) => request.post(`${API.GETSHEET}?id=${data.id}&userId=${data.userId}`)
export const updateSheet = (data: updateSheetType) => request.post(API.UPDATESHEET, data)
export const deleteSheet = (data: sheetUserType) => request.post(API.DELSHEETUSER, data)
export const addSheet = (data: sheetUserType) => request.post(API.ADDSHEETUSER, data)
export const addFavorites = (data: sheetUserType) => request.post(API.ADDFAVORITES, data)